package com.java.score

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.databinding.DataBindingUtil
import androidx.lifecycle.ViewModelProviders
import com.java.score.databinding.ActivityMainBinding

class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        //setContentView(R.layout.activity_main)
        val binding:ActivityMainBinding = DataBindingUtil.setContentView(this,R.layout.activity_main)
        //get  a viewModel instance
        val viewModel:MyViewModel = ViewModelProviders.of(this).get(MyViewModel::class.java)
        binding.data = viewModel
        binding.lifecycleOwner = this
    }
}
